﻿<div id="about-example">

    <h2>About this example <span class="viewengine-switch">@(Html.ActionLink("ASPX",
            (string)ViewContext.RouteData.Values["action"],
            new { area = "", controller = (string)ViewContext.RouteData.Values["controller"] },
            new { @class = "t-link" }))<span class="selected-engine">Razor</span></span></h2>    

    @(Html.Telerik().TabStrip()
            .Name("code-viewer-tabs")
            .Items(tabstrip =>
            {
                bool hasDescription = !string.IsNullOrEmpty((ViewData["Description"] ?? "").ToString());
                if (hasDescription)
                {
                    tabstrip.Add()
                        .Text("Description")
                        .Content(
                            @<div class="description">@ViewData["Description"] </div>
                        );
                }

                var codeFiles = ViewData.Get<Dictionary<string, string>>("codeFiles");

                foreach (var codeFile in codeFiles)
                {
                    tabstrip.Add()
                            .Text(codeFile.Key)
                            .LoadContentFrom("CodeFile", "Home", new { file = codeFile.Value });
                }
            })
            .SelectedIndex(0)
            .ClientEvents(events => events.OnLoad("codeTabLoad"))
    )
</div>